package com.example.designpatterns.iterator.concrete;

/**
 * 图书类 - 表示图书集合中的元素
 */
public class Book {
    private String name;
    private String author;
    private String category;
    private int price;
    
    /**
     * 创建一本图书
     * @param name 图书名称
     * @param author 作者
     * @param category 类别
     * @param price 价格
     */
    public Book(String name, String author, String category, int price) {
        this.name = name;
        this.author = author;
        this.category = category;
        this.price = price;
    }
    
    public String getName() {
        return name;
    }
    
    public String getAuthor() {
        return author;
    }
    
    public String getCategory() {
        return category;
    }
    
    public int getPrice() {
        return price;
    }
    
    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", category='" + category + '\'' +
                ", price=" + price +
                '}';
    }
} 